package com.github.live.manager;

import java.util.Properties;

/**
 * @ClassName Config
 * @description: 从配置文件中 读取基础配置
 * @author: biao532
 * @create: 2023-12-23 20:13
 * @Version 1.0
 **/
public class LiveConfig {

    // 维护 ijkplayer 的最大数量
    private int ijkM_maxCount;
    // selectorView 等待输入时间
    private int selectWaitfor;
    // 播放器缓冲超时重试
    private int bufferingWaitfor;
    // 频道详情等待 {} 后隐藏
    private int channelInfoWaitfor;
    // 菜单等待 {} 后隐藏
    private int menuWaitfor;
    // 设置等待 {} 后隐藏
    private int settingWaitfor;
    // 默认iRendView index
    private int iRendView;
    // 支持的最大分辨率
    private int supportedResolution;
    // 序号格式化
    private String numberFormat;
    // 是否支持自定义序号
    private boolean supportCustomNumber;
    protected LiveConfig(Properties properties) {
        this.ijkM_maxCount = Integer.valueOf(properties.getProperty("ijkMaxCount", "1"));
        this.selectWaitfor = Integer.valueOf(properties.getProperty("selectWaitfor", "3000"));
        this.bufferingWaitfor = Integer.valueOf(properties.getProperty("bufferingWaitfor", "4000"));
        this.channelInfoWaitfor = Integer.valueOf(properties.getProperty("channelInfoWaitfor", "5000"));
        this.menuWaitfor = Integer.valueOf(properties.getProperty("menuWaitfor", "5000"));
        this.settingWaitfor = Integer.valueOf(properties.getProperty("settingWaitfor", "5000"));
        // Source.RESOLUTION_4K
        this.supportedResolution = Integer.valueOf(properties.getProperty("supportedResolution", "3"));
        this.iRendView = Integer.valueOf(properties.getProperty("iRendView", "0"));
        this.numberFormat = properties.getProperty("numberFormat", "%04d");
        this.supportCustomNumber = Boolean.valueOf(properties.getProperty("supportCustomNumber", "false"));
    }

    public int getIjkM_maxCount() {
        return ijkM_maxCount;
    }

    public int getSelectWaitfor() {
        return selectWaitfor;
    }

    public int getBufferingWaitfor() {
        return bufferingWaitfor;
    }

    public int getChannelInfoWaitfor() {
        return channelInfoWaitfor;
    }

    public int getMenuWaitfor() {
        return menuWaitfor;
    }

    public int getSettingWaitfor() {
        return settingWaitfor;
    }

    public int getSupportedResolution() {
        return supportedResolution;
    }

    public int getIRendView() {
        return iRendView;
    }

    public String getNumberFormat() {
        return numberFormat;
    }

    public boolean isSupportCustomNumber() {
        return supportCustomNumber;
    }


}
